package com.atguigu.day14.test06;

import java.util.Arrays;

/**
 * @author fenge
 */
public class Test06 {
    private static int count;

    public static void main(String[] args) {
        System.out.println("源字符串：");
        String[] str = {"bac", "bacasf", "bacasdg", "bacsada", "bacsdahd"};
        System.out.println(Arrays.toString(str));


        for (int i = 0; i < str.length; i++) {
            if (str[i].length() <= 5)
                count++;
        }
        System.out.println("删除后：");
        String[] subStr = new String[count];
        int j = 0;
        for (int i = 0; i < str.length; i++) {
            if (str[i].length() <= 5) {
                subStr[j] = str[i];
                j++;
            }
        }
        System.out.println(Arrays.toString(subStr));
    }
}
